/**
 * Created by sunyan on 2017/7/6.
 */
import './assets/css/animation.css'
import './assets/css/equipmentMap.css'
import './assets/css/layer.scss'

import  "./assets/js/jQuery.XDomainRequest"
import indexBoxTemplate from "../../public_components/index_box_template"
import {changeLevel} from './assets/js/equipmentMap'
import {animation} from './assets/js/animation'
import {getElementDesc} from './assets/js/showDesc'
import {interaction} from './assets/js/layer'
require('script-loader!../../public/js/typedarray.js')



// 定义全局变量
window.config = {
  mapIp:'http://121.42.252.26', //http://121.42.187.170/
  // mapIp:'http://10.0.1.147:8080',
  promiseStep: 0,
  showConTimer_1: null, //画分类引线动画，在showDecs.js引入
  showConTimer_2: null  //画分类引线动画，在showDecs.js引入
}

indexBoxTemplate("#homepageBg")
changeLevel.change()

animation.readyFunction()
animation.verticalMiddle()
$('#labels').find('.label-box').on({
  'mouseover':function () {
    animation.lightLabels($(this))   //鼠标经过小分类层，停止动画
  },
  'click':function () {
    var  that = this;
    setTimeout(function () {
      getElementDesc($(that))    //鼠标点击小分类层，画出曲线
    },100)
  }
})

$('#level3').find('g.arc,text').on({ //第三层：扇形层鼠标滑过，点击，回归
  'mouseover':function () {
    animation.goBack($(this))
  },
  'click':function () {
    animation.goBack($(this))
  }
})

// layer.showLayer('hw-layer')
animation.animationStart()   //动画开始
let globalClearTimer = setTimeout(function () {   //1分钟后，用户什么都没有做，恢复动画最初的样子
  animation.restoreAnimation();
},60000)

$(document).on("click", "*", function(){   //点击空白处，恢复动画最初的样子
  animation.restoreAnimation();
  return false;
});
$("#level11-g,.label-box,#showContainer,#verticalLine,#classify_1,#classify_2,#classify_3,#classify_4,#classify_5,#text_1,#text_2,#text_3,#text_4,#text_5").click(function(){return false})


interaction.showEquipmentDetail()
           .hideEquipmentDetail()
           .tatContent()


